<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">.b1{white-space-collapsing:preserve;}
.b2{margin: 1.0in 1.18125in 1.0in 1.18125in;}
.p1{text-align:center;hyphenate:auto;font-family:宋体;font-size:26pt;}
.p2{text-align:center;hyphenate:auto;font-family:宋体;font-size:14pt;}
.p3{text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p4{text-align:center;hyphenate:auto;font-family:宋体;font-size:24pt;}
.p5{margin-left:0.14583333in;margin-right:-0.072916664in;text-align:center;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p6{margin-left:0.14583333in;margin-right:-0.072916664in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p7{text-indent:0.13680555in;margin-left:0.14583333in;margin-right:-0.072916664in;text-align:start;hyphenate:auto;font-family:Times New Roman;font-size:10pt;}
.p8{margin-left:0.14583333in;margin-right:-0.072916664in;text-align:start;hyphenate:auto;font-family:Times New Roman;font-size:10pt;}
.p9{text-indent:-0.29930556in;margin-left:0.29930556in;text-align:start;hyphenate:auto;font-family:宋体;font-size:14pt;}
.p10{text-indent:0.14583333in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p11{text-indent:-0.29166666in;margin-left:0.5833333in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p12{text-indent:-0.4in;margin-left:0.54583335in;margin-right:0.14583333in;margin-top:0.06944445in;margin-bottom:0.06944445in;text-align:start;hyphenate:auto;font-family:宋体;font-size:12pt;}
.p13{margin-left:0.35972223in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p14{text-align:center;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p15{text-indent:0.29166666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p16{text-indent:-0.29166666in;margin-left:0.7875in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p17{margin-left:0.7875in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p18{text-indent:-0.29166666in;margin-left:0.59097224in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p19{margin-left:0.59097224in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p20{text-indent:-0.3in;margin-left:0.3in;text-align:start;hyphenate:auto;font-family:宋体;font-size:14pt;}
.p21{text-indent:0.29166666in;margin-left:0.068055555in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p22{margin-left:0.29166666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p23{text-indent:0.29166666in;margin-left:0.29166666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p24{text-indent:0.29166666in;text-align:start;hyphenate:auto;font-family:Times New Roman;font-size:10pt;}
.p25{text-indent:-0.29166666in;margin-left:0.5833333in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p26{margin-left:0.5833333in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p27{text-indent:-0.25in;margin-left:0.25in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p28{margin-left:0.4375in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p29{text-indent:0.29166666in;margin-left:0.5833333in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p30{text-indent:0.29166666in;margin-left:0.875in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p31{margin-left:0.29583332in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p32{text-indent:0.16736111in;text-align:start;hyphenate:auto;font-family:宋体;font-size:12pt;}
.p33{margin-left:0.49861112in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p34{text-indent:0.29166666in;margin-left:0.20694445in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p35{margin-left:0.40138888in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p36{text-align:center;hyphenate:auto;font-family:宋体;font-size:11pt;}
.p37{margin-right:0.14583333in;margin-top:0.06944445in;margin-bottom:0.06944445in;text-align:start;hyphenate:auto;font-family:宋体;font-size:12pt;}
.p38{margin-left:0.09861111in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p39{text-indent:0.2777778in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p40{margin-left:0.2638889in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p41{margin-left:0.29166666in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p42{text-indent:0.29166666in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p43{margin-left:0.4375in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p44{text-indent:0.33402777in;margin-left:0.39375in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p45{text-indent:0.33402777in;margin-left:0.3923611in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p46{margin-left:0.74930555in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p47{text-indent:0.2888889in;margin-left:0.103472225in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p48{text-indent:0.18819444in;margin-left:0.103472225in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p49{margin-left:0.23333333in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p50{text-indent:0.083333336in;text-align:start;hyphenate:auto;font-family:宋体;font-size:12pt;}
.p51{text-indent:0.20694445in;margin-left:0.29166666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p52{text-indent:0.21944444in;margin-left:0.29166666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p53{text-indent:0.072916664in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p54{text-indent:0.29166666in;margin-left:0.10972222in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p55{text-align:start;hyphenate:auto;font-family:宋体;font-size:12pt;}
.p56{text-indent:0.21944444in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p57{margin-left:0.6125in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p58{text-align:start;hyphenate:auto;font-family:宋体;font-size:14pt;}
.p59{text-indent:0.88611114in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p60{margin-left:0.2777778in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p61{margin-left:0.59652776in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p62{margin-left:0.56805557in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p63{margin-left:0.59791666in;text-align:start;hyphenate:auto;font-family:宋体;font-size:10pt;}
.p64{text-indent:-0.3in;margin-left:0.3in;margin-top:0.083333336in;margin-bottom:0.083333336in;text-align:start;hyphenate:auto;keep-together.within-page:always;keep-with-next.within-page:always;font-family:宋体;font-size:14pt;}
.p65{margin-left:0.3in;text-align:justify;hyphenate:auto;font-family:宋体;font-size:10pt;}
.s1{font-weight:bold;}
.s2{color:blue;text-decoration:underline;}
.s3{font-family:Calibri;}
.s4{font-family:Times New Roman;}
.s5{font-family:宋体;color:blue;text-decoration:underline;}
.s6{display: inline-block; text-indent: 0; min-width: 0.4861111in;}
.s7{font-weight:bold;text-transform:uppercase;}
.s8{display: inline-block; text-indent: 0; min-width: 0.19444445in;}
.s9{display: inline-block; text-indent: 0; min-width: 0.3402778in;}
.s10{color:black;}
.s11{font-weight:bold;color:#c00000;}
.s12{display: inline-block; text-indent: 0; min-width: 0.49027777in;}
.s13{display: inline-block; text-indent: 0; min-width: 0.18680556in;}
.s14{font-weight:bold;color:black;}
.s15{color:#c00000;}
.s16{color:red;}
.s17{color:#365f91;}
.s18{font-weight:bold;color:red;}
.td1{width:1.0541667in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td2{width:2.3888888in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td3{width:2.429861in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td4{width:1.8326389in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td5{width:3.975in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td6{width:0.95208335in;padding-start:0.075in;padding-end:0.075in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td7{width:2.4465277in;padding-start:0.075in;padding-end:0.075in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td8{width:2.1881945in;padding-start:0.075in;padding-end:0.075in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td9{width:1.5076389in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td10{width:1.4701389in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td11{width:1.4743055in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td12{width:0.7125in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td13{width:2.9847221in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td14{width:2.1340277in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td15{width:1.5097222in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td16{width:1.9076389in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td17{width:1.5743055in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td18{width:1.2798611in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td19{width:2.2208333in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td20{width:1.5201389in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td21{width:1.1458334in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td22{width:2.2652779in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td23{width:2.2513888in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td24{width:1.5541667in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td25{width:4.108333in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td26{width:1.74375in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.td27{width:3.91875in;padding-start:0.0in;padding-end:0.0in;border-bottom:thin solid black;border-left:thin solid black;border-right:thin solid black;border-top:thin solid black;}
.r1{keep-together:always;}
.r2{height:0.5875in;keep-together:always;}
.r3{height:0.39444444in;keep-together:always;}
.r4{height:0.38125in;keep-together:always;}
.r5{height:0.2361111in;}
.r6{height:0.2361111in;keep-together:always;}
.r7{height:0.21597221in;keep-together:always;}
.r8{height:0.35277778in;keep-together:always;}
.t1{table-layout:fixed;border-collapse:collapse;border-spacing:0;}
</style>
<title>北京红树科技&mdash;HTTP短信接口文档</title>
<meta content="thinkpad" name="author">
</head>
<body class="b1 b2">
<p class="p1"></p>
<p class="p1"></p>
<p class="p1"></p>
<p class="p1">
<a name="_Toc76870969"><span class="s1">短信平台</span><span class="s1">接口文档</span></a>
</p>
<p class="p2">
<span class="s1">版本：V1.1.0</span>
</p>
<p class="p2">
<br>
<span class="s1">最新修改时间:2016-08-29</span>
</p>
<p class="p3">
<span> </span>
</p>
<br>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3">
<a name="_Toc327372797"></a>
</p>
<p class="p4">
<span class="s1">目   录</span>
</p>
<p class="p5"></p>
<p class="p6">
<span> TOC \o "1-3" \h \z \u </span><a href="#_Toc460230478"><span class="s2">1</span><span class="s3">	</span><span class="s2">下发接口地址方法一</span><span class="s4">	</span><a href="#_Toc460230478"><span class="s4">4</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230479"><span class="s5">1.1</span><span class="s3">	</span><span class="s5">短信下发参数</span><span>	</span><a href="#_Toc460230479"><span>4</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230480"><span class="s5">1.2</span><span class="s3">	</span><span class="s5">下发返回参数说明</span><span>	</span><a href="#_Toc460230480"><span>5</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230481"><span class="s5">2</span><span class="s3">	</span><span class="s5">下发接口地址方法二</span><span>	</span><a href="#_Toc460230481"><span>5</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230482"><span class="s5">2.1</span><span class="s3">	</span><span class="s5">短信发送参数</span><span>	</span><a href="#_Toc460230482"><span>5</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230483"><span class="s5">2.2</span><span class="s3">	</span><span class="s5">发送返回说明</span><span>	</span><a href="#_Toc460230483"><span>6</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230484"><span class="s5">3</span><span class="s3">	</span><span class="s5">个性化短信群发</span><span>	</span><a href="#_Toc460230484"><span>7</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230485"><span class="s5">3.1</span><span class="s3">	</span><span class="s5">个性化短信群发接口地址</span><span>	</span><a href="#_Toc460230485"><span>7</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230486"><span class="s5">3.2</span><span class="s3">	</span><span class="s5">个性化短信发送参数</span><span>	</span><a href="#_Toc460230486"><span>7</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230487"><span class="s5">3.3</span><span class="s3">	</span><span class="s5">发送返回说明</span><span>	</span><a href="#_Toc460230487"><span>7</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230488"><span class="s5">3.4</span><span class="s3">	</span><span class="s5">提交方式说明</span><span>	</span><a href="#_Toc460230488"><span>8</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230489"><span class="s5">4</span><span class="s3">	</span><span class="s5">账户余额查询</span><span>	</span><a href="#_Toc460230489"><span>8</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230490"><span class="s5">4.1</span><span class="s3">	</span><span class="s5">余额接口地址</span><span>	</span><a href="#_Toc460230490"><span>8</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230491"><span class="s5">4.2</span><span class="s3">	</span><span class="s5">余额接口参数</span><span>	</span><a href="#_Toc460230491"><span>8</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230492"><span class="s5">4.3</span><span class="s3">	</span><span class="s5">余额返回参数说明</span><span>	</span><a href="#_Toc460230492"><span>8</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230493"><span class="s5">5</span><span class="s3">	</span><span class="s5">状态报告推送</span><span>	</span><a href="#_Toc460230493"><span>9</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230494"><span class="s5">5.1</span><span class="s3">	</span><span class="s5">状态报告推送方式</span><span>	</span><a href="#_Toc460230494"><span>9</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230495"><span class="s5">5.2</span><span class="s3">	</span><span class="s5">状态报告推送样例</span><span>	</span><a href="#_Toc460230495"><span>9</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230496"><span class="s5">5.3</span><span class="s3">	</span><span class="s5">状态报告响应结果</span><span>	</span><a href="#_Toc460230496"><span>10</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230497"><span class="s5">6</span><span class="s3">	</span><span class="s5">客户主动获取状态报告接口</span><span>	</span><a href="#_Toc460230497"><span>10</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230498"><span class="s5">6.1</span><span class="s3">	</span><span class="s5">访问接口地址</span><span>	</span><a href="#_Toc460230498"><span>10</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230499"><span class="s5">6.2</span><span class="s3">	</span><span class="s5">访问参数说明</span><span>	</span><a href="#_Toc460230499"><span>10</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230500"><span class="s5">6.3</span><span class="s3">	</span><span class="s5">返回参数说明</span><span>	</span><a href="#_Toc460230500"><span>10</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230501"><span class="s5">6.4</span><span class="s3">	</span><span class="s5">状态</span><span class="s5">报告获取样例</span><span>	</span><a href="#_Toc460230501"><span>11</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230502"><span class="s5">5.5  </span><span class="s5">状态报告获取策略</span><span>	</span><a href="#_Toc460230502"><span>11</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230503"><span class="s5">7</span><span class="s3">	</span><span class="s5">上行信息推送</span><span>	</span><a href="#_Toc460230503"><span>12</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230504"><span class="s5">7.1</span><span class="s3">	</span><span class="s5">上行信息推送方式</span><span>	</span><a href="#_Toc460230504"><span>12</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230505"><span class="s5">7.2</span><span class="s3">	</span><span class="s5">上行</span><span class="s5">信息</span><span class="s5">推送样例</span><span>	</span><a href="#_Toc460230505"><span>12</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230506"><span class="s5">7.3</span><span class="s3">	</span><span class="s5">上行信息响应结果</span><span>	</span><a href="#_Toc460230506"><span>12</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230507"><span class="s5">8</span><span class="s3">	</span><span class="s5">客户主动获取上行接口</span><span>	</span><a href="#_Toc460230507"><span>13</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230508"><span class="s5">8.1</span><span class="s3">	</span><span class="s5">访问接口地址</span><span>	</span><a href="#_Toc460230508"><span>13</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230509"><span class="s5">8.2</span><span class="s3">	</span><span class="s5">访问参数说明</span><span>	</span><a href="#_Toc460230509"><span>13</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230510"><span class="s5">8.3</span><span class="s3">	</span><span class="s5">返回参数说明</span><span>	</span><a href="#_Toc460230510"><span>13</span></a></a>
</p>
<p class="p7">
<a href="#_Toc460230511"><span class="s5">8.4</span><span class="s3">	</span><span class="s5">上行信息</span><span class="s5">获取</span><span class="s5">样例</span><span>	</span><a href="#_Toc460230511"><span>13</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230512"><span class="s5">9</span><span class="s3">	</span><span class="s5">附录（</span><span class="s5">java</span><span class="s5">下发短信</span><span class="s5">demo</span><span class="s5">）</span><span>	</span><a href="#_Toc460230512"><span>14</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230513"><span class="s5">10</span><span class="s3">	</span><span class="s5">附录（</span><span class="s5">java</span><span class="s5">个性化短信群发</span><span class="s5">demo</span><span class="s5">）</span><span>	</span><a href="#_Toc460230513"><span>15</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230514"><span class="s5">11</span><span class="s3">	</span><span class="s5">附录（</span><span class="s5">java</span><span class="s5">查询余额</span><span class="s5">demo</span><span class="s5">）</span><span>	</span><a href="#_Toc460230514"><span>16</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230515"><span class="s5">12</span><span class="s3">	</span><span class="s5">附录</span><span class="s5"> (java</span><span class="s5">接收上行</span><span class="s5">demo)</span><span>	</span><a href="#_Toc460230515"><span>17</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230516"><span class="s5">13</span><span class="s3">	</span><span class="s5">附录（主动获取上行</span><span class="s5">/</span><span class="s5">状态报告</span><span class="s5">demo</span><span class="s5">）</span><span>	</span><a href="#_Toc460230516"><span>18</span></a></a>
</p>
<p class="p8">
<a href="#_Toc460230517"><span class="s5">14</span><span class="s3">	</span><span class="s5">附录（关于域名解析的相关说明）</span><span>	</span><a href="#_Toc460230517"><span>19</span></a></a>
</p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p3"></p>
<p class="p9">
<span class="s6">1​&nbsp;</span><a name="_Toc329166818"><a name="_Toc460230478"><span class="s7">下发接口地址</span></a></a><span class="s7">方法一</span>
</p>
<p class="p10">
<span>服务器接口地址：http://client.cloud.hbsmservice.com:8080/sms_send2.do</span>
</p>
<p class="p11">
<span class="s8">1.​&nbsp;</span><span>POST方式调用，请您参考此文档最后附录（java下发短信demo）。</span>
</p>
<p class="p12">
<span class="s9">1.1​&nbsp;</span><a name="_Toc288811428"><a name="_Toc306783686"><a name="_Toc329166819"><a name="_Toc460230479"><span class="s7">短信下发参数</span></a></a></a></a>
</p>
<p class="p13">
<span>参数说明：</span>
</p>
<table class="t1">
<tbody>
<tr class="r1">
<td class="td1">
<p class="p14">
<span class="s1">参数名称</span>
</p>
</td><td class="td2">
<p class="p14">
<span class="s1">参数说明</span>
</p>
</td><td class="td3">
<p class="p14">
<span class="s1">备注</span>
</p>
</td>
</tr>
<tr>
<td class="td1">
<p class="p14">
<span class="s10">corp_id</span>
</p>
</td><td class="td2">
<p class="p14">
<span>访问接口账户id</span>
</p>
</td><td class="td3" rowspan="3">
<p class="p14"></p>
<p class="p14">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr>
<td class="td1">
<p class="p14">
<span class="s10">corp_pwd</span>
</p>
</td><td class="td2">
<p class="p14">
<span>访问接口账户密码</span>
</p>
</td>
</tr>
<tr>
<td class="td1">
<p class="p14">
<span class="s10">corp_service</span>
</p>
</td><td class="td2">
<p class="p14">
<span>业务代码</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td1">
<p class="p14">
<span class="s10">mobile</span>
</p>
</td><td class="td2">
<p class="p14">
<span>下发用户手机号码</span>
</p>
</td><td class="td3">
<p class="p14">
<span>多个号码之间用英文逗号隔开，且一次群发总号码数不能超过200个</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td1">
<p class="p14">
<span class="s10">msg_content</span>
</p>
</td><td class="td2">
<p class="p14">
<span>短信内容</span>
</p>
</td><td class="td3">
<p class="p14">
<span>短信内容长度不超过1000个汉字（包括1000字），每个英文或阿拉伯字符也算1个汉字</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td1">
<p class="p14">
<span class="s10">corp_msg_id</span>
</p>
</td><td class="td2">
<p class="p14">
<span>用户发送短信时自己定义的短信id，用于区分状态报告。</span><span class="s1">参数名必须填写，参数值可为空，为空时，系统自动生成</span>
</p>
</td><td class="td3">
<p class="p14">
<span>总长度不能超过50个字符</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td1">
<p class="p14">
<span class="s10">ext</span>
</p>
</td><td class="td2">
<p class="p14">
<span>用户自行分配扩展号。</span><span class="s1">参数名必须填写，参数值可为空</span><span>。</span>
</p>
<p class="p14">
<span>该参数是显示在接收手机上的主叫尾号，可用于上行信息匹配，例：我方给合作方主叫号码号为：10657532521924，合作方在发送信息时可随意填写扩展号（需为0-9数字）ext=8888，那么用户收到信息时显示的下发号码就是106575325219248888</span>
</p>
</td><td class="td3">
<p class="p14">
<span>通道本身主叫号码加上用户自己分配扩展号的总长度不能超过20位</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p15">
<span class="s11">注意：</span>
</p>
<p class="p16">
<span class="s12">1)​&nbsp;</span><span>发送速度：接口访问没有时间间隔限制。建议用户等到接口返回值后，再进行下一次调用，可多线程并发调用。</span>
</p>
<p class="p16">
<span class="s12">2)​&nbsp;</span><span>Ip白名单：如果用户开账户时指定IP，则此接口只接收指定IP的发送请求，提高安全性。</span>
</p>
<p class="p17">
<span>IP支持单IP，多IP，IP号段及无IP。</span>
</p>
<p class="p16">
<span class="s12">3)​&nbsp;</span><span>内容长度：本接口支持每条短信内容的最大长度不超过1000个汉字（包括1000字）。</span>
</p>
<p class="p16">
<span class="s12">4)​&nbsp;</span><span class="s10">编码格式：utf-8。</span>
</p>
<p class="p12">
<span class="s9">1.2​&nbsp;</span><a name="_Toc288811429"><a name="_Toc306783687"><a name="_Toc329166820"><a name="_Toc460230480"><span class="s7">下发返回参数说明</span></a></a></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s1">返回代码</span>
</p>
</td><td class="td5">
<p class="p14">
<span class="s1">代码说明</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">0#数字</span>
</p>
</td><td class="td5">
<p class="p14">
<span>提交成功。数字：提交成功的手机数量</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">100</span>
</p>
</td><td class="td5">
<p class="p14">
<span>余额不足</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">101</span>
</p>
</td><td class="td5">
<p class="p14">
<span>账号关闭</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">102</span>
</p>
</td><td class="td5">
<p class="p14">
<span>短信内容超过1000字（包括1000字）或为空</span>
</p>
</td>
</tr>
<tr class="r2">
<td class="td4">
<p class="p14">
<span class="s10">103</span>
</p>
</td><td class="td5">
<p class="p14">
<span>手机号码超过200个或合法手机号码为空或者与通道类型不匹配</span>
</p>
</td>
</tr>
<tr class="r3">
<td class="td4">
<p class="p14">
<span class="s10">104</span>
</p>
</td><td class="td5">
<p class="p14">
<span class="s10">corp_msg_id超过50个字符或没有传corp_msg_id字段</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">106</span>
</p>
</td><td class="td5">
<p class="p14">
<span>用户名不存在</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">107</span>
</p>
</td><td class="td5">
<p class="p14">
<span>密码错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">108</span>
</p>
</td><td class="td5">
<p class="p14">
<span>指定访问ip错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">109</span>
</p>
</td><td class="td5">
<p class="p14">
<span>业务代码不存在或者通道关闭</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">110</span>
</p>
</td><td class="td5">
<p class="p14">
<span>扩展号不合法</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td4">
<p class="p14">
<span class="s10">9</span>
</p>
</td><td class="td5">
<p class="p14">
<span>访问地址不存在</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p15">
<span class="s11">注意：</span>
</p>
<p class="p18">
<span class="s13">1)​&nbsp;</span><span>长短信：对于长短信，&ldquo;#&rdquo;后面的数字代表用户提交的条数，而不是实际扣费的条数。例如用户发送了190字的短信三条，返回的是0#3,后台根据拆分后的结果，计费为9条。</span>
</p>
<p class="p18">
<span class="s13">2)​&nbsp;</span><span class="s10">0#数字：此返回值数字代表成功提交到我方平台的数据。失败条数不会显示，失败号码也不会显示。</span>
</p>
<p class="p19"></p>
<p class="p20">
<span class="s6">2​&nbsp;</span><a name="_Toc460230481"><span class="s7">下发接口地址</span><span class="s7">方法二</span></a>
</p>
<p class="p3">
<span>服务器接口地址： http://client.cloud.hbsmservice.com:8080/post_sms.do</span>
</p>
<p class="p21">
<span>POST方式调用，请参考此文档最后附录（java下发短信demo）。</span>
</p>
<p class="p12">
<span class="s9">2.1​&nbsp;</span><a name="_Toc288806649"><a name="_Toc364175147"><a name="_Toc428264098"><a name="_Toc460230482"><span class="s7">短信发送参数</span></a></a></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r4">
<td class="td6">
<p class="p14">
<span class="s14">参数名称</span>
</p>
</td><td class="td7">
<p class="p14">
<span class="s14">参数说明</span>
</p>
</td><td class="td8">
<p class="p14">
<span class="s14">备注</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td6">
<p class="p3">
<span class="s10">id</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">用户id</span>
</p>
</td><td class="td8" rowspan="2">
<p class="p3">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td6">
<p class="p3">
<span class="s10">MD5_td_code</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">（密码+业务代码）MD5加密码</span>
</p>
</td>
</tr>
<tr class="r6">
<td class="td6">
<p class="p3">
<span class="s10">mobile</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">用户手机号码</span>
</p>
</td><td class="td8">
<p class="p3">
<span class="s10">多个号码用半角英文逗号隔开,一次最多不能超过200个</span>
</p>
</td>
</tr>
<tr class="r6">
<td class="td6">
<p class="p3">
<span class="s10">msg_content</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">下发短信内容</span>
</p>
</td><td class="td8">
<p class="p3">
<span class="s10">短信内容长度不超过1000个汉字（包括1000字）,每个英文或阿拉伯字符算1个汉字</span>
</p>
</td>
</tr>
<tr class="r6">
<td class="td6">
<p class="p3">
<span class="s10">msg_id</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">用户发送短信自己定义的短信id，用于处理群发状态报告，</span><span class="s14">参数名必须填写，参数值可为空。</span>
</p>
</td><td class="td8">
<p class="p3">
<span class="s10">英文和数字的组合总长度不超过50个字符</span>
</p>
</td>
</tr>
<tr class="r6">
<td class="td6">
<p class="p3">
<span class="s10">ext</span>
</p>
</td><td class="td7">
<p class="p3">
<span class="s10">用户自己分配的扩展号。</span><span class="s14">参数名必须填写，参数值可为空。</span><span class="s10">。该参数是显示在接收手机上的主叫尾号，可用于上行信息匹配</span>
</p>
</td><td class="td8">
<p class="p3">
<span class="s10">从00000到99999的范围,</span><span> </span><span class="s10">通道本身特服号加上用户自己分配扩展号的总长度不能超过20位。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p12">
<span class="s9">2.2​&nbsp;</span><a name="_Toc288806650"><a name="_Toc364175148"><a name="_Toc428264099"><a name="_Toc460230483"><span class="s7">发送返回说明</span></a></a></a></a>
</p>
<p class="p22">
<span>0#数字   提交成功的手机数</span>
</p>
<p class="p22">
<span>-10       余额不足</span>
</p>
<p class="p22">
<span>-11       账号关闭</span>
</p>
<p class="p22">
<span>-12       短信内容超过1000字（包括1000字）或为空</span>
</p>
<p class="p22">
<span>-13       手机号码超过200个或合法的手机号码为空，或者手机号码与通道代码正则不匹配</span>
</p>
<p class="p22">
<span>-14       msg_id超过50个字符或没有传msg_id字段</span>
</p>
<p class="p22">
<span>-16       用户名不存在</span>
</p>
<p class="p22">
<span>-18       访问ip错误</span>
</p>
<p class="p22">
<span>-19       密码错误 或者业务代码错误 或者通道关闭 或者业务关闭</span>
</p>
<p class="p22">
<span>-20       小号错误</span>
</p>
<p class="p22">
<span>9       访问地址不存在</span>
</p>
<p class="p23"></p>
<p class="p24">
<span class="s15">注意：</span>
</p>
<p class="p18">
<span class="s13">3)​&nbsp;</span><span>MD5_td_code：由密码+业务代码进行MD5加密后得到，例：密码为123，业务代码为955，则MD5_td_code是将123955放在MD5加密工具中用MD5加密后得到的值。</span>
</p>
<p class="p18">
<span class="s13">4)​&nbsp;</span><span>长短信：对于长短信，返回的是用户提交的条数，而不是实际扣费的条数，例如用户发送了190字的短信三条，返回的是ok：3，后台根据拆分后的结果，计费为9条。</span>
</p>
<p class="p18">
<span class="s13">5)​&nbsp;</span><span>-12错误：确认接口编码格式是否正确，测试标准是发送带有&ldquo;%&rdquo;的短信看是否能成功发送。</span>
</p>
<p class="p18">
<span class="s13">6)​&nbsp;</span><span>内容长度：本接口支持每条短信内容的最大长度不超过1000个汉字（包括1000字）。</span>
</p>
<p class="p18">
<span class="s13">7)​&nbsp;</span><span>IP访问：如果用户开账户时指定IP，则此接口只接收指定IP的发送请求。</span>
</p>
<p class="p18">
<span class="s13">8)​&nbsp;</span><span>可支持多ip或号段绑定。</span>
</p>
<p class="p18">
<span class="s13">9)​&nbsp;</span><span>发送速度：接口访问没有时间间隔限制。建议收到接口返回值后，再进行下一次调用。</span>
</p>
<p class="p19"></p>
<p class="p20">
<span class="s6">3​&nbsp;</span><a name="_Toc362523603"><a name="_Toc362871017"><a name="_Toc363203835"><a name="_Toc288811430"><a name="_Toc306783688"><a name="_Toc329166821"><a name="_Toc460230484"><span class="s7">个性化短信群发</span></a></a></a></a></a></a></a>
</p>
<p class="p12">
<span class="s9">3.1​&nbsp;</span><a name="_Toc362523604"><a name="_Toc362871018"><a name="_Toc363203836"><a name="_Toc460230485"><span class="s7">个性化短信群发接口地址</span></a></a></a></a>
</p>
<p class="p3">
<span>接口地址为：http://client.cloud.hbsmservice.com:8080/hSmsSend.do</span>
</p>
<p class="p12">
<span class="s9">3.2​&nbsp;</span><a name="_Toc363203837"><a name="_Toc362523605"><a name="_Toc362871019"><a name="_Toc460230486"><span class="s7">个性化短信发送参数</span></a></a></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r7">
<td class="td9">
<p class="p14">
<span>参数名称</span>
</p>
</td><td class="td10">
<p class="p14">
<span>参数定义</span>
</p>
</td><td class="td10">
<p class="p14">
<span>参数说明</span>
</p>
</td><td class="td11">
<p class="p14">
<span>备注</span>
</p>
</td>
</tr>
<tr>
<td class="td9">
<p class="p3">
<span>corp_id</span>
</p>
</td><td class="td10">
<p class="p3">
<span>企业id</span>
</p>
</td><td class="td10">
<p class="p3">
<span>企业身份标示</span>
</p>
</td><td class="td11" rowspan="3">
<p class="p14"></p>
<p class="p14">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr>
<td class="td9">
<p class="p3">
<span>corp_pwd</span>
</p>
</td><td class="td10">
<p class="p3">
<span>企业的密码</span>
</p>
</td><td class="td10">
<p class="p3">
<span>对应id标示</span>
</p>
</td>
</tr>
<tr>
<td class="td9">
<p class="p3">
<span>corp_service</span>
</p>
</td><td class="td10">
<p class="p3">
<span>业务代码</span>
</p>
</td><td class="td10">
<p class="p3">
<span>用来发送短信的业务</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td9">
<p class="p3">
<span>total_count</span>
</p>
</td><td class="td10">
<p class="p3">
<span>总条数</span>
</p>
</td><td class="td10">
<p class="p3">
<span>本次发送总条数</span>
</p>
</td><td class="td11">
<p class="p3">
<span>用来与接口拼凑完成后的实际条数进行校验。</span><span class="s1">不大于200</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td9">
<p class="p3">
<span>send_param</span>
</p>
</td><td class="td10">
<p class="p3">
<span>发送的短信的参数</span>
</p>
</td><td class="td10">
<p class="p3">
<span>发送的实际内容</span>
</p>
</td><td class="td11">
<p class="p3">
<span>1、每条个性化短信内容不能超过1000（包括1000字）字并且不能为空</span>
</p>
<p class="p3">
<span>2、主叫扩展号码只支持数字。主叫扩展号码+主叫号码&lt;20位</span>
<br>
<span>单次不超过200条短信</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td9">
<p class="p3">
<span>ctrl_param</span>
</p>
</td><td class="td10">
<p class="p3">
<span>控制参数</span>
</p>
</td><td class="td10">
<p class="p3">
<span>控制个性化提交的模式</span>
</p>
</td><td class="td11">
<p class="p3">
<span>暂时无用</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p3">
<span class="s11">说明：</span>
</p>
<p class="p25">
<span class="s8">1)​&nbsp;</span><span>send_param格式：手机号码&amp;split&amp;短消息序号&amp;split&amp;主叫扩展号码&amp;split&amp;短消息内容。</span>
</p>
<p class="p26"></p>
<p class="p25">
<span class="s8">2)​&nbsp;</span><span>每条短信之间&amp;group&amp;以分隔。以&amp;group&amp;拆分后的短信条数必须等于</span>
</p>
<p class="p25">
<span class="s8">3)​&nbsp;</span><span>total_count，如有差别，则全部失败。</span>
</p>
<p class="p25">
<span class="s8">4)​&nbsp;</span><span>主叫扩展号码不限制长度，但是需保证通道接入号+主叫扩展号&le;20，总长度超过20位则发送失败</span>
</p>
<p class="p25">
<span class="s8">5)​&nbsp;</span><span>样例：</span>
</p>
<p class="p22">
<span>send_param=13601025412&amp;split&amp;20110608122535001&amp;split&amp;256&amp;split&amp;尊敬的会员张三您好，您的账户余额为20元&amp;group&amp;13821056854&amp;split&amp;2011060812255425003&amp;split&amp;257&amp;split&amp;尊敬的会员李四您好，您的账户余额为30.2元</span>
</p>
<p class="p12">
<span class="s9">3.3​&nbsp;</span><a name="_Toc363203838"><a name="_Toc362523606"><a name="_Toc362871020"><a name="_Toc460230487"><span class="s7">发送返回说明</span></a></a></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>参数</span>
</p>
</td><td class="td13">
<p class="p14">
<span>说明</span>
</p>
</td><td class="td14">
<p class="p14">
<span>备注</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>0#数字</span>
</p>
</td><td class="td13">
<p class="p3">
<span>提交成功#提交成功的短信数量</span>
</p>
</td><td class="td14">
<p class="p27">
<span class="s6">1、​&nbsp;</span><span>通道支持长短信整条提交则返回长短信数；若不支持整条提交则返回拆分后短信总数；</span>
</p>
<p class="p27">
<span class="s6">2、​&nbsp;</span><span>0#0：表示此次个性化短信全部提交失败。</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>100</span>
</p>
</td><td class="td13">
<p class="p3">
<span>余额不足</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>101</span>
</p>
</td><td class="td13">
<p class="p3">
<span>账号关闭</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>106</span>
</p>
</td><td class="td13">
<p class="p3">
<span>用户名不存在</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>107</span>
</p>
</td><td class="td13">
<p class="p3">
<span>密码错误</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>108</span>
</p>
</td><td class="td13">
<p class="p3">
<span>指定访问的IP错误</span>
</p>
</td><td class="td14">
<p class="p3">
<span>接口支持绑定单IP，多IP，IP号段及无IP</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>109</span>
</p>
</td><td class="td13">
<p class="p3">
<span>业务不存在</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>114</span>
</p>
</td><td class="td13">
<p class="p3">
<span>接口提交应为POST，不支持GET</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>115</span>
</p>
</td><td class="td13">
<p class="p3">
<span>total_count 与实际短信条数无法匹配，即，实际短信条数与total_count不一致。</span>
</p>
<p class="p3">
<span>如果要返回此参数，则本次提交的所有短信作废，不入库</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>116</span>
</p>
</td><td class="td13">
<p class="p3">
<span>个性化短信提交个数超过200条</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td12">
<p class="p14">
<span>9</span>
</p>
</td><td class="td13">
<p class="p3">
<span>访问地址不存在</span>
</p>
</td><td class="td14">
<p class="p3"></p>
</td>
</tr>
</tbody>
</table>
<p class="p12">
<span class="s9">3.4​&nbsp;</span><a name="_Toc362523607"><a name="_Toc362871021"><a name="_Toc363203839"><a name="_Toc460230488"><span class="s7">提交方式说明</span></a></a></a></a>
</p>
<p class="p22">
<span>考虑到短信内容长度拼接后较长，接口支持HTTP协议中的POST方法，不支持GET方法。并且由于个性化参数中本身带有&amp;符号，所以不能使用curl命令测试。具体请您参考此文档最后附录（java发送个性化短信demo）进行测试。</span>
</p>
<p class="p20">
<span class="s6">4​&nbsp;</span><a name="_Toc460230489"><span class="s7">账户余额查询</span></a>
</p>
<p class="p12">
<span class="s9">4.1​&nbsp;</span><a name="_Toc288811431"><a name="_Toc306783689"><a name="_Toc329166822"><a name="_Toc460230490"><span class="s7">余额接口地址</span></a></a></a></a>
</p>
<p class="p15">
<span>余额接口地址：http://client.cloud.hbsmservice.com:8080/sms_count2.do</span>
</p>
<p class="p15">
<span>POST方式调用，请您参考此文档附录10（java查询余额demo）。</span>
</p>
<p class="p12">
<span class="s9">4.2​&nbsp;</span><a name="_Toc288811432"><a name="_Toc306783690"><a name="_Toc329166823"><a name="_Toc460230491"><span class="s7">余额接口参数</span></a></a></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r1">
<td class="td15">
<p class="p14">
<span class="s1">参数名称</span>
</p>
</td><td class="td16">
<p class="p14">
<span class="s1">参数说明</span>
</p>
</td><td class="td17">
<p class="p14">
<span class="s1">备注</span>
</p>
</td>
</tr>
<tr>
<td class="td15">
<p class="p14">
<span>corp_id</span>
</p>
</td><td class="td16">
<p class="p14">
<span>访问接口账户id</span>
</p>
</td><td class="td17" rowspan="2">
<p class="p14">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr>
<td class="td15">
<p class="p14">
<span>corp_pwd</span>
</p>
<p class="p14"></p>
</td><td class="td16">
<p class="p14">
<span>访问接口账户密码</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p3">
<a name="_Toc329166824"><span class="s16">注意事项：接口访问频率限制为5次/秒，即两次访问间隔需在200ms以上</span></a>
</p>
<p class="p12">
<span class="s9">4.3​&nbsp;</span><a name="_Toc460230492"><span class="s7">余额返回参数说明</span></a>
</p>
<p class="p28">
<a name="_Toc288811433"><a name="_Toc306783691"><a name="_Toc329166825"><span>1）正常返回状态：ok#余额 </span></a></a></a>
</p>
<p class="p28">
<span>2）错误返回状态：</span>
</p>
<table class="t1">
<tbody>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>参数</span>
</p>
</td><td class="td19">
<p class="p14">
<span>说明</span>
</p>
</td><td class="td20">
<p class="p14">
<span>备注</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>101</span>
</p>
</td><td class="td19">
<p class="p3">
<span>账号关闭</span>
</p>
</td><td class="td20">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>104</span>
</p>
</td><td class="td19">
<p class="p3">
<span class="s10">两次访问间隔</span><span>小于200ms</span>
</p>
</td><td class="td20">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>106</span>
</p>
</td><td class="td19">
<p class="p3">
<span>用户名不存在</span>
</p>
</td><td class="td20">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>107</span>
</p>
</td><td class="td19">
<p class="p3">
<span>密码错误</span>
</p>
</td><td class="td20">
<p class="p3"></p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>108</span>
</p>
</td><td class="td19">
<p class="p3">
<span>指定访问的IP错误</span>
</p>
</td><td class="td20">
<p class="p3">
<span>接口支持绑定单IP，多IP，IP号段及无IP</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td18">
<p class="p14">
<span>9</span>
</p>
</td><td class="td19">
<p class="p3">
<span>访问地址不存在</span>
</p>
</td><td class="td20">
<p class="p3"></p>
</td>
</tr>
</tbody>
</table>
<p class="p20">
<span class="s6">5​&nbsp;</span><a name="_Toc460230493"><span class="s7">状态报告推送</span></a>
</p>
<p class="p12">
<span class="s9">5.1​&nbsp;</span><a name="_Toc460230494"><span class="s7">状态报告推送方式</span></a>
</p>
<p class="p15">
<span>状态报告内容：用以确认短信是否下发成功。我方主动将状态报告内容以GBK编码形式推送给用户。</span>
</p>
<p class="p3">
<span>状态报告推送地址：由客户提供状态报告接收地址，类似http://.......dfdf.do或者是http://.......dfdf.aspx 等等。</span>
</p>
<p class="p12">
<span class="s9">5.2​&nbsp;</span><a name="_Toc460230495"><span class="s7">状态报告推送样例</span></a>
</p>
<p class="p15">
<span>推送的数据样例(为一整条xml格式的字符串，注：是一整条字符串，不是xml文档)</span>
</p>
<p class="p15">
<span>&lt;?xml version="1.0" encoding="GBK" ?&gt;</span>
</p>
<p class="p23">
<span>&lt;reports&gt;</span>
</p>
<p class="p29">
<span>&lt;report&gt;</span>
</p>
<p class="p30">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p30">
<span>&lt;mobile&gt;13810000001&lt;/mobile&gt;</span>
</p>
<p class="p30">
<span>&lt;sub_seq&gt;0&lt;/sub_seq&gt;(0表示整条，其余数字表示一条长短信被拆分的第几条)</span>
</p>
<p class="p30">
<span>&lt;msg_id&gt;12345asd&lt;/msg_id&gt;</span>
</p>
<p class="p30">
<span>&lt;err&gt;2&lt;/err&gt;（表示具体的错误码，其中err为0或000均表示为成功）</span>
</p>
<p class="p30">
<span>&lt;fail_desc&gt;undeliver&lt;/fail_desc&gt;（表示具体的错误描述）</span>
</p>
<p class="p30">
<span>&lt;report_time&gt;2010-07-02 00:00:00&lt;/report_time&gt;</span>
</p>
<p class="p29">
<span>&lt;/report&gt;</span>
</p>
<p class="p29">
<span>&lt;report&gt;</span>
</p>
<p class="p30">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p30">
<span>&lt;mobile&gt;13810000002&lt;/mobile&gt;</span>
</p>
<p class="p30">
<span>&lt;sub_seq&gt;0&lt;/sub_seq&gt;</span>
</p>
<p class="p30">
<span>&lt;msg_id&gt;12345asd&lt;/msg_id&gt;</span>
</p>
<p class="p30">
<span>&lt;err&gt;2&lt;/err&gt;（表示具体的错误码，其中err为0或000均表示为成功）</span>
</p>
<p class="p30">
<span>&lt;fail_desc&gt;undeliver&lt;/fail_desc&gt;</span>
</p>
<p class="p30">
<span>&lt;report_time&gt;2010-07-02 00:00:00&lt;/report_time&gt;</span>
</p>
<p class="p29">
<span>&lt;/report&gt;</span>
</p>
<p class="p23">
<span>&lt;/reports&gt;</span>
</p>
<p class="p3">
<span class="s11">备注：</span>
</p>
<p class="p31">
<span>一个reports最多可包含100个report节点，即一个状态报告xml字符串最多可包含100个状态报告。</span>
</p>
<p class="p31">
<span>状态报告可根据mobile 和msg_id唯一标识。</span>
</p>
<p class="p12">
<span class="s9">5.3​&nbsp;</span><a name="_Toc460230496"><span class="s7">状态报告响应结果</span></a>
</p>
<p class="p22">
<span>用户接收到我方推送的状态报告时，需返回响应结果。</span>
</p>
<p class="p22">
<span>0: 接收成功。</span>
</p>
<p class="p32">
<span class="s1">4.4 状态推送策略</span>
</p>
<p class="p33">
<span class="s1">推送策略</span><span>：</span>
</p>
<p class="p33">
<span>	 我方设置响应超时时间为20秒。如果我方在20秒之内未收到、或未收到正确的用户响应结果，则按用户接收失败处理。处理方式如下：我方重复推送该条状态报告，最多连续推送三次，每次间隔2s。三次推送失败后，此条状态报告信息不再继续推送。</span>
</p>
<p class="p33">
<span class="s1">重复推送机制</span><span>：</span>
</p>
<p class="p33">
<span>	 如因状态报告推送地址配置有误、或网络等外部原因导致状态报告推送失败的，如需要，可联系我方技术人员再次推送，推送策略同上。</span>
</p>
<p class="p34">
<span class="s1">建议</span><span>：</span>
</p>
<p class="p3">
<span class="s1">		 </span><span>建议当接收到状态报告xml字符串时，先给我方回复响应，同时将信息保存起来，之后再进行数据处理工作。否则，边接收边处理，处理后再给响应，会影响状态报告推送效率，造成积压。</span>
</p>
<p class="p20">
<span class="s6">6​&nbsp;</span><a name="_Toc354750893"><a name="_Toc288811434"><a name="_Toc306783692"><a name="_Toc329166828"><a name="_Toc460230497"><span class="s7">客户主动获取状态报告</span></a></a></a></a></a><span class="s7">接口</span>
</p>
<p class="p12">
<span class="s9">6.1​&nbsp;</span><a name="_Toc354750894"><a name="_Toc460230498"><span class="s7">访问接口地址</span></a></a>
</p>
<p class="p35">
<span>访问地址：http://client.cloud.hbsmservice.com:8080/post_report.do</span>
</p>
<p class="p35">
<span>访问方式：post方式，具体请见此文档最后附录：主动获取上行/状态报告demo。</span>
</p>
<p class="p35">
<span>编码：GBK编码形式。</span>
</p>
<p class="p12">
<span class="s9">6.2​&nbsp;</span><a name="_Toc354750895"><a name="_Toc460230499"><span class="s7">访问参数说明</span></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r4">
<td class="td21">
<p class="p14">
<span class="s1">参数名称</span>
</p>
</td><td class="td22">
<p class="p14">
<span class="s1">参数说明</span>
</p>
</td><td class="td23">
<p class="p14">
<span class="s1">备注</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">corp_id</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户用户名</span>
</p>
</td><td class="td23" rowspan="3">
<p class="p3"></p>
<p class="p3">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">user_id</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户用户名</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">corp_pwd</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户密码</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p3">
<span>	</span>
</p>
<p class="p12">
<span class="s9">6.3​&nbsp;</span><a name="_Toc354750896"><a name="_Toc460230500"><span class="s7">返回参数说明</span></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r8">
<td class="td24">
<p class="p36">
<a name="OLE_LINK1"><a name="OLE_LINK2"><a name="OLE_LINK3"><a name="_Hlk353117227"><span class="s1">返回代码</span></a></a></a></a>
</p>
</td><td class="td25">
<p class="p14">
<span class="s1">代码说明</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">0</span>
</p>
</td><td class="td25">
<p class="p3">
<span>暂时没有待推送的数据</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">9</span>
</p>
</td><td class="td25">
<p class="p3">
<span>访问地址不存在</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">-11</span>
</p>
</td><td class="td25">
<p class="p3">
<span>账户关闭</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">-16</span>
</p>
</td><td class="td25">
<p class="p3">
<span>用户名错误或用户名不存在</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">-17</span>
</p>
</td><td class="td25">
<p class="p3">
<span>密码错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">-18</span>
</p>
</td><td class="td25">
<p class="p3">
<span>不支持客户主动获取</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">-19</span>
</p>
</td><td class="td25">
<p class="p3">
<span>用户访问超过我方限制频率（间隔200毫秒访问一次）</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">108</span>
</p>
</td><td class="td25">
<p class="p3">
<span>指定访问IP错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td24">
<p class="p3">
<span class="s17">Xml格式字符串</span>
</p>
</td><td class="td25">
<p class="p3">
<span>有待推送的状态报告，并且状态报告以xml格式的字符串返回。</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p12">
<span class="s9">6.4​&nbsp;</span><a name="_Toc354750901"><a name="_Toc366658668"><a name="_Toc460230501"><span class="s7">状态</span><span class="s7">报告获取</span><span class="s7">样例</span></a></a></a>
</p>
<p class="p15">
<span>用于客户查询每条短信发送的状态是否成功。</span>
</p>
<p class="p15">
<span>推送的数据样例(为一整条xml格式的字符串，注：是一整条字符串，不是xml文档)</span>
</p>
<p class="p15">
<span>&lt;?xml version="1.0" encoding="GBK" ?&gt;</span>
</p>
<p class="p23">
<span>&lt;reports&gt;</span>
</p>
<p class="p29">
<span>&lt;report&gt;</span>
</p>
<p class="p30">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p30">
<span>&lt;mobile&gt;13810000001&lt;/mobile&gt;</span>
</p>
<p class="p30">
<span>&lt;sub_seq&gt;0&lt;/sub_seq&gt;(0表示整条，其余数字表示一条长短信被拆分的第几条)</span>
</p>
<p class="p30">
<span>&lt;msg_id&gt;12345asd&lt;/msg_id&gt;</span>
</p>
<p class="p30">
<span>&lt;err&gt;2&lt;/err&gt;（表示具体的错误码，其中err为0或000均表示为成功）</span>
</p>
<p class="p30">
<span>&lt;fail_desc&gt;undeliver&lt;/fail_desc&gt;（表示具体的错误描述）</span>
</p>
<p class="p30">
<span>&lt;report_time&gt;2010-07-02 00:00:00&lt;/report_time&gt;</span>
</p>
<p class="p29">
<span>&lt;/report&gt;</span>
</p>
<p class="p29">
<span>&lt;report&gt;</span>
</p>
<p class="p30">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p30">
<span>&lt;mobile&gt;13810000002&lt;/mobile&gt;</span>
</p>
<p class="p30">
<span>&lt;sub_seq&gt;0&lt;/sub_seq&gt;</span>
</p>
<p class="p30">
<span>&lt;msg_id&gt;12345asd&lt;/msg_id&gt;</span>
</p>
<p class="p30">
<span>&lt;err&gt;2&lt;/err&gt;（表示具体的错误码，其中err为0或000均表示为成功）</span>
</p>
<p class="p30">
<span>&lt;fail_desc&gt;undeliver&lt;/fail_desc&gt;</span>
</p>
<p class="p30">
<span>&lt;report_time&gt;2010-07-02 00:00:00&lt;/report_time&gt;</span>
</p>
<p class="p29">
<span>&lt;/report&gt;</span>
</p>
<p class="p23">
<span>&lt;/reports&gt;</span>
</p>
<p class="p3">
<span class="s11">备注：</span>
</p>
<p class="p15">
<span>一个reports最多可包含100个report节点，即一个状态报告xml字符串最多可包含100个状态报告。</span>
</p>
<p class="p37">
<a name="_Toc460230502"><span class="s7">5.5</span><span class="s7">  </span><span class="s7">状态报告获取策略</span></a>
</p>
<p class="p15">
<span class="s1">获取策略</span><span>：</span>
</p>
<p class="p38">
<span>	  </span><span class="s10">客户可访问我方提供的接口地址，主动获取状态报告信息，一个状态报告xml字符串最多可包含100个状态报告，每次获取间隔时间要大于等于200ms，待获取的信息在我方平台最多保留三天，超过三天则自动转移为历史数据，最多保留三个月。</span>
</p>
<p class="p15">
<span class="s14">重复获取</span><span class="s10">：</span>
</p>
<p class="p3">
<span class="s10">	  如因特殊原因未取成功的，如需要，可</span><span>联系我方技术人员进行处理，可重新获取，获取策略同上。</span>
</p>
<p class="p20">
<span class="s6">7​&nbsp;</span><a name="_Toc460230503"><span class="s7">上行信息推送</span></a>
</p>
<p class="p12">
<span class="s9">7.1​&nbsp;</span><a name="_Toc460230504"><span class="s7">上行信息推送方式</span></a>
</p>
<p class="p15">
<a name="_Toc329166829"><span>上行信息内容：手机用户给发送方回复的信息。</span><span>我方主动将上行信息内容</span><span>以GBK编码形式</span><span>推送给用户。</span></a>
</p>
<p class="p39">
<span>上行接收地址：由客户提供接收上行信息的url地址，类似</span><a href="http://.......dfdf.do"><span class="s2">http://.......dfdf.do</span></a><span>或者是</span><a href="http://.......dfdf.aspx"><span>http://.......dfdf.aspx</span></a><span> 等等。</span>
</p>
<p class="p12">
<span class="s9">7.2​&nbsp;</span><a name="_Toc460230505"><span class="s7">上行</span><span class="s7">信息</span><span class="s7">推送样例</span></a>
</p>
<p class="p40">
<span>推送的数据样例：(为一整条xml格式的字符串，注：是一整条字符串，不是xml文档)</span>
</p>
<p class="p41">
<span>&lt;?xml version="1.0" encoding="GBK" ?&gt; </span>
</p>
<p class="p42">
<span>&lt;delivers&gt;</span>
</p>
<p class="p43">
<span>&lt;deliver&gt;</span>
</p>
<p class="p44">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p45">
<span>&lt;mobile&gt;13810000000&lt;/mobile&gt;</span>
</p>
<p class="p46">
<span>&lt;ext&gt;8888&lt;/ext&gt; (对应下发时的ext参数，根据手机用户回复短信（即上行信息）的ext的值， 匹配客户或者客户下发的信息)</span>
</p>
<p class="p44">
<span>&lt;time&gt;2010-07-02 00:00:00&lt;/time&gt;\</span>
</p>
<p class="p45">
<span>&lt;content&gt;收到&lt;/content&gt;</span>
</p>
<p class="p47">
<span>&lt;/deliver&gt;</span>
</p>
<p class="p48">
<span>&lt;/delivers&gt;</span>
</p>
<p class="p3">
<span class="s11">注意：</span>
</p>
<p class="p49">
<span>一条上行xml字符串最多可包含10个&lt; deliver &gt;&lt;/ deliver&gt;节点。</span>
</p>
<p class="p49">
<span>上行信息根据mobile 和完整接入号唯一标识一个账户。</span>
</p>
<p class="p12">
<span class="s9">7.3​&nbsp;</span><a name="_Toc329166830"><a name="_Toc460230506"><span class="s7">上行信息响应结果</span></a></a>
</p>
<p class="p22">
<a name="_Toc288811435"><a name="_Toc306783693"><span>用户接收到我方推送的上行信息时，需返回响应结果。</span></a></a>
</p>
<p class="p22">
<span>0: 接收成功。</span>
</p>
<p class="p22">
<span class="s11">注意：</span>
</p>
<p class="p50">
<span class="s1">6.4   上行推送策略</span>
</p>
<p class="p51">
<span class="s1">推送策略</span><span>：</span>
</p>
<p class="p22">
<span>	  我方设置响应超时时间为20秒。如果我方在20秒之内未收到、或未收到正确的用户响应结果，则按用户接收失败处理。处理方式如下：我方重复推送该条上行信息，最多连续推送三次，每次间隔2s。三次推送失败后，此条上行信息不再继续推送。</span>
</p>
<p class="p52">
<span class="s1">重复推送机制</span><span>：</span>
</p>
<p class="p22">
<span>	 如因上行推送地址配置有误、或网络等外部原因导致上行信息推送失败的，如需要，可联系我方技术人员再次推送，推送策略同上。</span>
</p>
<p class="p52">
<span class="s1">建议</span><span>：</span>
</p>
<p class="p53">
<span class="s1">		 </span><span>建议当接收到上行xml字符串时，先给我方回复响应，同时将信息保存起来，之后再进行数据处理工作。否则，边接收边处理，处理后再给响应，会影响上行推送效率，造成积压。</span>
</p>
<p class="p20">
<span class="s6">8​&nbsp;</span><a name="_Toc354750897"><a name="_Toc460230507"><span class="s7">客户主动获取上行</span><span class="s7">接口</span></a></a>
</p>
<p class="p12">
<span class="s9">8.1​&nbsp;</span><a name="_Toc354750898"><a name="_Toc460230508"><span class="s7">访问接口地址</span></a></a>
</p>
<p class="p54">
<span>访问地址：http://client.cloud.hbsmservice.com:8080/post_deliverMsg.do</span>
</p>
<p class="p54">
<span>访问方式：post方式，具体请见此文档最后附录：主动获取上行/状态报告demo。</span>
</p>
<p class="p54">
<span>编码：GBK编码形式。</span>
</p>
<p class="p12">
<span class="s9">8.2​&nbsp;</span><a name="_Toc354750899"><a name="_Toc460230509"><span class="s7">访问参数说明</span></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r4">
<td class="td21">
<p class="p14">
<span class="s1">参数名称</span>
</p>
</td><td class="td22">
<p class="p14">
<span class="s1">参数说明</span>
</p>
</td><td class="td23">
<p class="p14">
<span class="s1">备注</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">corp_id</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户用户名</span>
</p>
</td><td class="td23" rowspan="3">
<p class="p3"></p>
<p class="p3">
<span class="s10">由供应商提供</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">user_id</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户用户名</span>
</p>
</td>
</tr>
<tr class="r5">
<td class="td21">
<p class="p3">
<span class="s17">corp_pwd</span>
</p>
</td><td class="td22">
<p class="p3">
<span>一级账户密码</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p12">
<span class="s9">8.3​&nbsp;</span><a name="_Toc354750900"><a name="_Toc460230510"><span class="s7">返回参数说明</span></a></a>
</p>
<table class="t1">
<tbody>
<tr class="r8">
<td class="td26">
<p class="p36">
<span class="s1">返回代码</span>
</p>
</td><td class="td27">
<p class="p14">
<span class="s1">代码说明</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">0</span>
</p>
</td><td class="td27">
<p class="p3">
<span>暂时没有待推送的数据</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">9</span>
</p>
</td><td class="td27">
<p class="p3">
<span>访问地址不存在</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">-11</span>
</p>
</td><td class="td27">
<p class="p3">
<span>账户关闭</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">-16</span>
</p>
</td><td class="td27">
<p class="p3">
<span>用户名错误或用户名不存在</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">-17</span>
</p>
</td><td class="td27">
<p class="p3">
<span>密码错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">-18</span>
</p>
</td><td class="td27">
<p class="p3">
<span>不支持客户主动获取</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">-19</span>
</p>
</td><td class="td27">
<p class="p3">
<span>用户访问超过我方限制频率 （间隔200毫秒访问一次）</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">108</span>
</p>
</td><td class="td27">
<p class="p3">
<span>指定访问IP错误</span>
</p>
</td>
</tr>
<tr class="r1">
<td class="td26">
<p class="p3">
<span class="s17">Xml格式字符串</span>
</p>
</td><td class="td27">
<p class="p3">
<span>有待推送的上行信息，并且上行信息以xml格式的字符串返回。一条上行xml字符串可包含10个&lt; deliver &gt;&lt;/ deliver&gt;节点</span>
</p>
</td>
</tr>
</tbody>
</table>
<p class="p12">
<span class="s9">8.4​&nbsp;</span><a name="_Toc329166831"><a name="_Toc460230511"><span class="s7">上行信息</span><span class="s7">获取</span><span class="s7">样例</span></a></a>
</p>
<p class="p40">
<span>推送的数据样例：(为一整条xml格式的字符串，注：是一整条字符串，不是xml文档)</span>
</p>
<p class="p41">
<span>&lt;?xml version="1.0" encoding="GBK" ?&gt; </span>
</p>
<p class="p42">
<span>&lt;delivers&gt;</span>
</p>
<p class="p43">
<span>&lt;deliver&gt;</span>
</p>
<p class="p44">
<span>&lt;corp_id&gt;test&lt;/corp_id&gt;</span>
</p>
<p class="p45">
<span>&lt;mobile&gt;13810000000&lt;/mobile&gt;</span>
</p>
<p class="p46">
<span>&lt;ext&gt;8888&lt;/ext&gt; (对应下发时的ext参数，根据手机用户回复短信（即上行信息）的ext的值， 匹配客户或者客户下发的信息)</span>
</p>
<p class="p44">
<span>&lt;time&gt;2010-07-02 00:00:00&lt;/time&gt;\</span>
</p>
<p class="p45">
<span>&lt;content&gt;收到&lt;/content&gt;</span>
</p>
<p class="p47">
<span>&lt;/deliver&gt;</span>
</p>
<p class="p48">
<span>&lt;/delivers&gt;</span>
</p>
<p class="p3">
<span class="s11">注意：</span>
</p>
<p class="p49">
<span>一条上行xml字符串最多包含10个&lt; deliver &gt;&lt;/ deliver&gt;节点。</span>
</p>
<p class="p55">
<span class="s1">7.5 上行获取策略</span>
</p>
<p class="p15">
<span class="s1">获取策略</span><span>：</span>
</p>
<p class="p38">
<span>	  </span><span class="s10">客户可访问我方提供的接口地址，主动获取上行信息，一个上行xml字符串最多可包含10个节点，每次获取间隔时间要大于等于200ms，待获取的信息在我方平台最多保留三天，超过三天则自动转移为历史数据，最多保留三个月。</span>
</p>
<p class="p56">
<span class="s14">重复获取</span><span class="s10">：</span>
</p>
<p class="p3">
<span class="s10">	 如因特殊原因未取成功的，如需要，可</span><span>联系我方技术人员再次进行处理，可重新获取，获取策略同上。</span>
</p>
<p class="p20">
<span class="s6">9​&nbsp;</span><a name="_Toc460230512"><span class="s7">附录（java下发短信demo）</span></a>
</p>
<p class="p3"></p>
<p class="p3">
<span class="s10">	public static void main(String[] args) throws Exception {</span>
</p>
<p class="p23">
<span>HttpClient client = new HttpClient();</span>
</p>
<p class="p23">
<span>PostMethod post = new PostMethod("</span><a href="http://client.cloud.hbsmservice.com:8080/sms_send2.do"><span class="s2">http://client.cloud.hbsmservice.com:8080/sms_send2.do</span></a><span>");     </span>
</p>
<p class="p57">
<span>post.addRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");//在头文件中设置转码</span>
</p>
<p class="p23">
<span>NameValuePair[] data ={ </span>
</p>
<p class="p29">
<span>new NameValuePair("corp_id", "访问接口账户id"),</span>
</p>
<p class="p29">
<span>new NameValuePair("corp_pwd", "访问接口账户密码"),</span>
</p>
<p class="p29">
<span>new NameValuePair("corp_service","业务代码"),</span>
</p>
<p class="p29">
<span>new NameValuePair("mobile","下发目的手机号码"),</span>
</p>
<p class="p29">
<span>new NameValuePair("msg_content","下发短信内容"),</span>
</p>
<p class="p29">
<span>new NameValuePair("corp_msg_id ","短信Id"),</span>
</p>
<p class="p29">
<span>new NameValuePair("ext ","扩展小号")</span>
</p>
<p class="p23">
<span>};</span>
</p>
<p class="p23">
<span>post.setRequestBody(data);</span>
</p>
<p class="p3">
<span>		client.executeMethod(post);</span>
</p>
<p class="p3">
<span>		Header[] headers = post.getResponseHeaders();</span>
</p>
<p class="p3">
<span>		int statusCode = post.getStatusCode();</span>
</p>
<p class="p3">
<span>		System.out.println("statusCode:"+statusCode);</span>
</p>
<p class="p3">
<span>		for(Header h : headers){</span>
</p>
<p class="p3">
<span>	    	System.out.println(h.toString());</span>
</p>
<p class="p3">
<span>		}</span>
</p>
<p class="p23">
<span>String result = new String(post.getResponseBodyAsString()); </span>
</p>
<p class="p3">
<span>   		System.out.println(result);</span>
</p>
<p class="p3">
<span>    	post.releaseConnection();</span>
</p>
<p class="p22">
<span>}</span>
</p>
<p class="p58">
<span class="s6">10​&nbsp;</span><a name="_Toc362871033"><a name="_Toc363203851"><a name="_Toc329166832"><a name="_Toc460230513"><span class="s7">附录（java个性化短信群发demo）</span></a></a></a></a>
</p>
<p class="p39">
<span>	public static int send_cat(String corp_id, String corp_pwd, String url,</span>
</p>
<p class="p39">
<span>		String corp_service, int total_count, String send_param,int ctrl_para){</span>
</p>
<p class="p39">
<span>			int result =-1;</span>
</p>
<p class="p39">
<span>			HttpClient client = new HttpClient();</span>
</p>
<p class="p39">
<span>			PostMethod method = new PostMethod(url);</span>
</p>
<p class="p59">
<span>method.addRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");</span>
</p>
<p class="p39">
<span>			try{</span>
</p>
<p class="p39">
<span>				method.addParameter("corp_id", corp_id);</span>
</p>
<p class="p39">
<span>				method.addParameter("corp_pwd", corp_pwd);</span>
</p>
<p class="p39">
<span>				method.addParameter("corp_service", corp_service);</span>
</p>
<p class="p39">
<span>				method.addParameter("total_count",total_count+"");</span>
</p>
<p class="p39">
<span>				method.addParameter("send_param",send_param);</span>
</p>
<p class="p39">
<span>				method.addParameter("ctrl_param", ctrl_param+"");</span>
</p>
<p class="p39">
<span>				client.executeMethod(method);</span>
</p>
<p class="p39">
<span>				String sendResult = method.getResponseBodyAsString();</span>
</p>
<p class="p39">
<span>					System.out.println("============="+sendResult);</span>
</p>
<p class="p39">
<span>				}catch (Exception e) {</span>
</p>
<p class="p39">
<span>				e.printStackTrace();</span>
</p>
<p class="p39">
<span>				result = -1;</span>
</p>
<p class="p39">
<span>			}finally{</span>
</p>
<p class="p39">
<span>				try{</span>
</p>
<p class="p39">
<span>					method.releaseConnection();</span>
</p>
<p class="p39">
<span>				}catch (Exception e) {</span>
</p>
<p class="p39">
<span>					e.printStackTrace();</span>
</p>
<p class="p39">
<span>				}</span>
</p>
<p class="p39">
<span>			}</span>
</p>
<p class="p39">
<span>			return result;</span>
</p>
<p class="p39">
<span>		}</span>
</p>
<p class="p39">
<span>		public static void main(String[] args) {</span>
</p>
<p class="p39">
<span>			long start=System.currentTimeMillis();</span>
</p>
<p class="p39">
<span>			System.out.println(start);</span>
</p>
<p class="p39">
<span>			String tel="手机号码";</span>
</p>
<p class="p39">
<span>			String content=短信内容";</span>
</p>
<p class="p39">
<span>			String msg_id="短消息序号";</span>
</p>
<p class="p39">
<span>			String code="主叫扩展号";</span>
</p>
<p class="p39">
<span>			String split="&amp;split&amp;";</span>
</p>
<p class="p39">
<span>			String group="&amp;group&amp;";</span>
</p>
<p class="p39">
<span>			String send_param = "";</span>
</p>
<p class="p39">
<span>			String[] array={tel,msg_id,code,content};</span>
</p>
<p class="p39">
<span>			StringBuffer sb=null;</span>
</p>
<p class="p39">
<span>			int length=2;</span>
</p>
<p class="p39">
<span>			for (int i = 0; i &lt; length; i++) {</span>
</p>
<p class="p39">
<span>				sb=new StringBuffer();</span>
</p>
<p class="p39">
<span>				for (int j = 0; j &lt; array.length; j++) {</span>
</p>
<p class="p39">
<span>					if((j+1)==array.length){</span>
</p>
<p class="p39">
<span>						sb.append(array[j]+i);	</span>
</p>
<p class="p39">
<span>					}else{</span>
</p>
<p class="p39">
<span>					sb.append(array[j]+split);</span>
</p>
<p class="p39">
<span>					}</span>
</p>
<p class="p39">
<span>				}</span>
</p>
<p class="p39">
<span>				if((i+1)==length){</span>
</p>
<p class="p39">
<span>				send_param+=sb.toString();</span>
</p>
<p class="p39">
<span>				}else {</span>
</p>
<p class="p39">
<span>				send_param+=sb.toString()+group;	</span>
</p>
<p class="p39">
<span>				}</span>
</p>
<p class="p39">
<span>				sb=null;</span>
</p>
<p class="p39">
<span>			}</span>
</p>
<p class="p39">
<span>			System.out.println(System.currentTimeMillis()-start);</span>
</p>
<p class="p39">
<span>			System.out.println(send_param);</span>
</p>
<p class="p39">
<span>			</span>
</p>
<p class="p39">
<span>			char[] c = send_param.toString().toCharArray();</span>
</p>
<p class="p39">
<span>			System.out.println("charlength= " + c.length);</span>
</p>
<p class="p39">
<span>					</span>
</p>
<p class="p39">
<span>			String corp_id = "企业id";</span>
</p>
<p class="p39">
<span>			String corp_pwd = "企业密码";</span>
</p>
<p class="p39">
<span>			String url = " http://client.cloud.hbsmservice.com:8080/hSmsSend.do "; </span>
</p>
<p class="p39">
<span>			String corp_service="业务代码";</span>
</p>
<p class="p39">
<span>			int total_count =length;</span>
</p>
<p class="p39">
<span>			AntoSmsTest.send_cat(corp_id, corp_pwd, url,corp_service,total_count, send_param,1);</span>
</p>
<p class="p39">
<span>		}</span>
</p>
<p class="p20">
<span class="s6">11​&nbsp;</span><a name="_Toc460230514"><span class="s7">附录（java查询余额demo）</span></a>
</p>
<p class="p22">
<span class="s10">public static void main(String[] args)throws Exception{</span>
</p>
<p class="p23">
<span>HttpClient client = new HttpClient();</span>
</p>
<p class="p23">
<span>PostMethod post = new PostMethod("http://client.cloud.hbsmservice.com:8080/sms_count2.do "); </span>
</p>
<p class="p57">
<span>post.addRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");//在头文件中设置转码</span>
</p>
<p class="p23">
<span>NameValuePair[] data ={</span>
</p>
<p class="p29">
<span>new NameValuePair("corp_id", "访问接口账户id "),</span>
</p>
<p class="p29">
<span>new NameValuePair("corp_id","访问接口账户id "),</span>
</p>
<p class="p29">
<span>new NameValuePair("user_id","访问接口账户id "),</span>
</p>
<p class="p29">
<span>new NameValuePair("pwd", "访问接口账户密码")</span>
</p>
<p class="p23">
<span>};</span>
</p>
<p class="p3">
<span>		post.setRequestBody(data);</span>
</p>
<p class="p3">
<span>		client.executeMethod(post);</span>
</p>
<p class="p3">
<span>		Header[] headers = post.getResponseHeaders();</span>
</p>
<p class="p3">
<span>		int statusCode = post.getStatusCode();</span>
</p>
<p class="p3">
<span>		System.out.println("statusCode:"+statusCode);</span>
</p>
<p class="p3">
<span>		for(Header h : headers){</span>
</p>
<p class="p3">
<span>	    	System.out.println(h.toString());</span>
</p>
<p class="p3">
<span>	 	}</span>
</p>
<p class="p3">
<span>	String result = new String(post.getResponseBodyAsString()); </span>
</p>
<p class="p22">
<span>System.out.println(result);</span>
</p>
<p class="p22">
<span>post.releaseConnection();</span>
</p>
<p class="p3">
<span>}</span>
</p>
<p class="p20">
<span class="s6">12​&nbsp;</span><a name="_Toc329166833"><a name="_Toc460230515"><span class="s7">附录 (java接收上行demo)</span></a></a>
</p>
<p class="p60">
<span>介绍：我方推送过去的xml格式的上行字符串，参照如下</span>
</p>
<p class="p22">
<span>String str="&lt;?xml version='1.0' encoding='GBK'?&gt;" </span>
</p>
<p class="p3">
<span>&lt;delivers&gt;" +"&lt;deliver&gt;&lt;corp_id&gt;test&lt;/corp_id&gt;&lt;mobile&gt;13860497631&lt;/mobile&gt;</span>
</p>
<p class="p61">
<span>&lt;ext&gt;2010&lt;/ext&gt;&lt;time&gt;2010-07-02 00:00:00&lt;/time&gt;&lt;content&gt;您好tuisong测试222&lt;/content&gt;&lt;/deliver&gt;" +"&lt;/delivers&gt;";</span>
</p>
<p class="p62">
<span>1.通过访问合作方给提供url地址，调用到合作方的URL，然后我方推送上行信息的xml字符串过去，合作方接收。</span>
</p>
<p class="p22">
<span>2.此条xml字符串，是存在requset的内存里。</span>
</p>
<p class="p63">
<span>3.需要接收方先取得request对象(注意这里request对象无参数，是直接存在request内存里，需要先从request里获取输入流，然后进行读流操作，读出推送内容)</span>
</p>
<p class="p22">
<span>参考如下：</span>
</p>
<p class="p15">
<span> protected void doPost(HttpServletRequest request, HttpServletResponse resp)</span>
</p>
<p class="p15">
<span>throws ServletException, IOException {</span>
</p>
<p class="p23">
<span>InputStream in = request.getInputStream();</span>
</p>
<p class="p23">
<span>BufferedInputStream buf = new BufferedInputStream(in);</span>
</p>
<p class="p23">
<span>byte[] buffer = new byte[1024];</span>
</p>
<p class="p23">
<span>StringBuffer data =new StringBuffer();</span>
</p>
<p class="p23">
<span>int a ;</span>
</p>
<p class="p23">
<span>while((a = buf.read(buffer))!= -1){</span>
</p>
<p class="p29">
<span>data.append(new String(buffer,0,a,"gbk"));</span>
</p>
<p class="p23">
<span>}</span>
</p>
<p class="p23">
<span>String getData = data.toString(); </span>
</p>
<p class="p23">
<span>System.out.println(getData );   //显示接收的字符串</span>
</p>
<p class="p23">
<span>if(getData.equals(null)||getData.equals("")){</span>
</p>
<p class="p29">
<span>resp.getWriter().write("9");}        //如果接收失败，返回9</span>
</p>
<p class="p29">
<span>else{</span>
</p>
<p class="p29">
<span>resp.getWriter().write("0");}        //如果接收成功，返回0</span>
</p>
<p class="p23">
<span>}</span>
</p>
<p class="p23"></p>
<p class="p15">
<span>protected void doGet(HttpServletRequest request, HttpServletResponse resp)</span>
</p>
<p class="p15">
<span>throws ServletException, IOException {</span>
</p>
<p class="p23">
<span>(request,resp);</span>
</p>
<p class="p15">
<span>} </span>
</p>
<p class="p22">
<span>4.解析取到的xml格式的字符串，取得推送上行内容的各个节点的值，DOM4j解析参考如下：</span>
</p>
<p class="p22">
<span>		Document doc = DocumentHelper.parseText(字符串); </span>
</p>
<p class="p22">
<span>		Element root = doc.getRootElement();</span>
</p>
<p class="p22">
<span>		List&lt;Element&gt; deliverElements = root.elements("deliver");</span>
</p>
<p class="p22">
<span>for(Element deliver:deliverElements){</span>
</p>
<p class="p22">
<span>		String corp_id = deliver.elementText("corp_id");</span>
</p>
<p class="p22">
<span>		String mobile = deliver.elementText("mobile");</span>
</p>
<p class="p22">
<span>		String ext = deliver.elementText("ext");</span>
</p>
<p class="p22">
<span>		String time = deliver.elementText("time");</span>
</p>
<p class="p22">
<span>		String content = deliver.elementText("content");</span>
</p>
<p class="p22">
<span>System.out.println(corp_id+":"+mobile+":"+ext+":"+time+":"+content);</span>
</p>
<p class="p22">
<span>		}</span>
</p>
<p class="p20">
<span class="s6">13​&nbsp;</span><a name="_Toc364168712"><a name="_Toc460230516"><span class="s7">附录（主动获取上行/状态报告demo）</span></a></a>
</p>
<p class="p15">
<span>HttpClient&nbsp;client&nbsp;=&nbsp;new&nbsp;HttpClient();</span>
</p>
<p class="p15">
<span>PostMethod&nbsp;post&nbsp;=&nbsp;new&nbsp;PostMethod("主动获取的URL地址");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
</p>
<p class="p15">
<span>post.addRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");//在头文件中设置转码</span>
</p>
<p class="p15">
<span>NameValuePair[]&nbsp;data&nbsp;={&nbsp;</span>
</p>
<p class="p23">
<span>new&nbsp;NameValuePair("corp_id",&nbsp;"访问接口账户id"),//一级账户id</span>
</p>
<p class="p23">
<span>new&nbsp;NameValuePair("corp_pwd","wehpns"),//一级账户密码密</span>
</p>
<p class="p23">
<span>&nbsp;&nbsp;};</span>
</p>
<p class="p22">
<span>post.setRequestBody(data);</span>
</p>
<p class="p22">
<span>client.executeMethod(post);</span>
</p>
<p class="p22">
<span>Header[]&nbsp;headers&nbsp;=&nbsp;post.getResponseHeaders();</span>
</p>
<p class="p22">
<span>int&nbsp;statusCode&nbsp;=&nbsp;post.getStatusCode();</span>
</p>
<p class="p22">
<span>System.out.println("statusCode:"+statusCode);</span>
</p>
<p class="p22">
<span>for(Header&nbsp;h&nbsp;:&nbsp;headers){</span>
</p>
<p class="p23">
<span>System.out.println(h.toString());</span>
</p>
<p class="p22">
<span>}</span>
</p>
<p class="p22">
<span>String&nbsp;result&nbsp;=&nbsp;new&nbsp;String(post.getResponseBodyAsString());&nbsp;</span>
</p>
<p class="p22">
<span>System.out.println(result);</span>
</p>
<p class="p22">
<span>post.releaseConnection();</span>
</p>
<p class="p64">
<span class="s6">14​&nbsp;</span><a name="_Toc423964191"><a name="_Toc423964481"><a name="_Toc460230517"><span class="s7">附录（关于域名解析的相关说明）</span></a></a></a>
</p>
<p class="p42">
<span class="s1">1.</span><span class="s18">请勿</span><span class="s1">直接在您的服务器系统 hosts 文件上写域名和IP 对应关系。</span>
</p>
<p class="p15">
<span>如：www.example.com   93.184.216.34</span>
</p>
<p class="p15">
<span>以免我司平台域名解析切换成新IP 后，您的服务器仍然解析成旧的 IP 地址。</span>
</p>
<p class="p65"></p>
<p class="p65">
<span class="s1">2.</span><span class="s18">请勿</span><span class="s1">在您的服务器系统上配置公司内部 DNS 服务器，建议配置成知名的 DNS 地址。</span>
</p>
<p class="p15">
<span>如(114.114.114.114)</span>
</p>
<p class="p15">
<span># cat /etc/resolv.conf </span>
</p>
<p class="p15">
<span>nameserver 114.114.114.114</span>
</p>
<p class="p15">
<span>nameserver 119.29.29.29</span>
</p>
<p class="p15">
<span>内部DNS 服务器或当地运营商的DNS 服务器大多DNS 解析变更时会有更新延迟(一般公司内部 DNS 的解析延迟时间可能多达一天), 以免我司平台域名解析切换成新IP 后，您的服务器在很长一段时间内仍然解析成旧的 IP 地址，造成无法访问我司短信平台。</span>
</p>
<p class="p3">
<span>我司使用 Dnspod 域名解析企业服务，一般更改解析后，知名的DNS 解析服务器会在2分钟后更新。</span>
</p>
<p class="p3"></p>
<p class="p65">
<span class="s1">3.如何确认在您的服务器上解析的域名是最新的解析IP:</span>
</p>
<p class="p15">
<span>访问 http://ping.chinaz.com/ ， 输入我司短信平台域名，查看全国各地解析的 IP 。</span>
</p>
<p class="p3">
<span>	如：</span>
</p>
<p class="p3">
<img src="66a2.png" style="width:5.625in;height:0.5625in;vertical-align:text-bottom;"></p>
<p class="p29">
<img src="7571.png" style="width:3.5104167in;height:2.5416667in;vertical-align:text-bottom;"></p>
<p class="p15">
<span>在您的服务器上 ping 我司平台域名，查看解析IP:</span>
</p>
<p class="p15">
<img src="964c.png" style="width:5.4791665in;height:0.8541667in;vertical-align:text-bottom;"></p>
<p class="p15">
<span class="s1">查看 全国解析的 IP 与您在服务器 ping 解析的 IP 是否一致。</span>
</p>
<p class="p15">
<span>如不一致，请检查本文档 (1，2) 所提到的情况，再尝试。或请联系我司客服确认我司平台在用IP，从而确认在您服务器解析的 IP 与我司平台在用IP 是否一致。</span>
</p>
<p class="p3"></p>
<p class="p65">
<span class="s1">4.Linux  服务器频繁调用域名解析及 DNS缓存问题</span>
</p>
<p class="p15">
<span>Linux系统默认没有 DNS 缓存, 想使用DNS缓存的话需要自己安装一个服务程序</span><span class="s1">NSCD(name service cache daemon).  </span><span>如果DNS设置成稳定知名的DNS 服务器， 一般情况下，请求时间与安装缓存的差异并不明显。</span>
</p>
<p class="p15">
<span class="s18">注：安装 DNS 缓存服务有以下优缺点：</span>
</p>
<p class="p15">
<span class="s1">优点： </span><span>对于频繁调用解析的域名， 可直接调用系统DNS缓存，提高解析速度。</span>
</p>
<p class="p15">
<span class="s1">缺点：</span><span> 我司DNS 解析变改 IP 后，由于缓存服务，您的服务器有缓存，会有DNS更新延迟，仍然解析成旧的 IP 地址，手工执行nscd -i hosts 命令或重启该服务 service nscd restart才可以立刻使缓存失效更新。</span>
</p>
<p class="p15">
<span>CentOS 系统安装方法：</span>
</p>
<p class="p15">
<span># yum install nscd</span>
</p>
<p class="p15">
<span>Ubuntu / Debian 系统安装方法：</span>
</p>
<p class="p15">
<span>apt-get install nscd</span>
</p>
<p class="p15">
<span>确认配置已开启 DNS 缓存</span>
</p>
<p class="p15">
<span># vim /etc/nscd.conf</span>
</p>
<p class="p15">
<span>enable-cache            hosts           yes</span>
</p>
<p class="p15">
<span># service nscd start</span>
</p>
<p class="p15">
<span>配置参考链接：</span>
</p>
<p class="p15">
<a href="http://linux.die.net/man/5/nscd.conf"><span class="s2">http://linux.die.net/man/5/nscd.conf</span></a>
</p>
<p class="p15">
<a href="http://my.oschina.net/phptiger86/blog/138507"><span class="s2">http://my.oschina.net/phptiger86/blog/138507</span></a>
</p>
<p class="p22">
<a href="http://www.361way.com/linux-nscd-dns-cache/4265.html"><span class="s2">http://www.361way.com/linux-nscd-dns-cache/4265.html</span></a>
</p>
</body>
</html>
